package com.webware.view.client.presenter;

import com.google.gwt.activity.shared.AbstractActivity;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.place.shared.Place;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.webware.view.client.ClientFactory;
import com.webware.view.client.place.StartPlace;
import com.webware.view.client.ui.StartView;

public class StartPresenter extends AbstractActivity implements Presenter {

    private ClientFactory clientFactory;

    public StartPresenter(StartPlace place, ClientFactory clientFactory) {
	this.clientFactory = clientFactory;
    }

    public void start(AcceptsOneWidget panel, EventBus eventBus) {
	StartView view = clientFactory.getStartView();
	view.setPresenter(this);
	panel.setWidget(view.asWidget());
    }

    public void goTo(Place place) {
	clientFactory.getPlaceController().goTo(place);
    }

}
